package p3_entities;


import java.io.Serializable;
import javax.persistence.*;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

import com.sun.xml.bind.CycleRecoverable;


import java.util.List;


/**
 * The persistent class for the lindenmovementstype database table.
 * 
 */
@Entity
@Table(name="lindenmovementstype")

@NamedQueries({

	@NamedQuery(name="getLindenMovementsTypes", 
		query="SELECT x FROM Lindenmovementstype x WHERE x.description=:description"),
		
	@NamedQuery(name="getAllLindenMovementsTypes", 
		query="SELECT x FROM Lindenmovementstype x ")

})

public class Lindenmovementstype implements Serializable, CycleRecoverable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="Id", unique=true, nullable=false)
	private int id;

	@Column(name="Description", nullable=false, length=45)
	private String description;

	//bi-directional many-to-one association to Lindenmovement
	@OneToMany(mappedBy="lindenmovementstype")
	@LazyCollection(LazyCollectionOption.FALSE)
	private List<Lindenmovement> lindenmovements;

    public Lindenmovementstype() {
    }
    
    public Lindenmovementstype(int id) {
    	this.id = id;
    }


	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public List<Lindenmovement> getLindenmovements() {
		return this.lindenmovements;
	}

	public void setLindenmovements(List<Lindenmovement> lindenmovements) {
		this.lindenmovements = lindenmovements;
	}

	@Override
	public Object onCycleDetected(Context arg0) {
		return new Lindenmovementstype(this.getId());
	}
	
}